﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using Light.Utility;
using System.ComponentModel;

namespace Light.Framework.Model
{
    /// <summary>
    /// 权限字典实体
    /// </summary>
    [Traceable]
    [DisplayName("权限项")]
    [ActiveRecord]
    public class Task : Entity
    {


        /// <summary>
        /// 权限代码
        /// </summary>
        [Property]
        [Searchable("代码")]
        public string Code { get; set; }


        /// <summary>
        /// 权限名称
        /// </summary>
        [Property("FName")]
        [Searchable("名称")]
        public string Name { get; set; }


        /// <summary>
        /// 分组名
        /// </summary>
        [Property]
        [Searchable("分组名")]
        public string GroupName { get; set; }


        /// <summary>
        /// 备注信息
        /// </summary>
        [Property]
        [Searchable("备注")]
        public string Remark { get; set; }

        /// <summary>
        ///使用状态
        /// </summary>
        [Property]
        public Status Status { get; set; }

        /// <summary>
        /// 显示顺序
        /// </summary>
        [Property]
        public int DisplayOrder { get; set; }

        ///// <summary>
        ///// 是否为保留权限（仅超级管理员可见）
        ///// </summary>
        //[Property]
        //public bool IsReserved { get; set; }

        /// <summary>
        /// 状态描述
        /// </summary>
        public string StatusDesc
        {
            get { return ReflectionHelper.GetEnumDescription(Status); }
        }

        public override bool Equals(object obj)
        {
            return this.Code == ((Task)obj).Code;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }

}
